using System;
using System.ComponentModel;
using Xtensive.Orm;

namespace SalesPoint.ViewModels
{
  public abstract class ViewModelBase : SessionBound, 
    INotifyPropertyChanged
  {
    public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void OnPropertyChanged(string propertyName)
    {
      var handler = PropertyChanged;
      if (handler == null) 
        return;
      var e = new PropertyChangedEventArgs(propertyName);
      handler(this, e);
    }

    protected ViewModelBase(Session session)
      : base(session)
    {
    }
  }
}